package com.example.mapssample;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity{
	static final LatLng THANH_XUAN = new LatLng(20.993776, 105.811417);
	static final LatLng TP_HO_CHI_MINH = new LatLng(10.8230989, 106.6296638);
	static final LatLng TU_LIEM = new LatLng(21.046723, 105.7484312);
	static final LatLng PHAM_HUNG = new LatLng(21.0182685, 105.7814214);
	static final LatLng NGUYEN_CHI_THANH = new LatLng(21.0207075, 105.8094335);
	private GoogleMap map;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_layout);
		
		 map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
			        .getMap();
			    map.addMarker(new MarkerOptions().position(THANH_XUAN)
			        .title("Thanh Xuân"));
			    map.addMarker(new MarkerOptions()
			        .position(TP_HO_CHI_MINH)
			        .title("Hồ Chí Minh")
			        .snippet("Kiel is cool")
			        .icon(BitmapDescriptorFactory
			            .fromResource(R.drawable.ic_launcher)));
			    map.addMarker(new MarkerOptions().position(TU_LIEM)
				        .title("Từ Liêm"));
			    map.addMarker(new MarkerOptions().position(PHAM_HUNG)
				        .title("Phạm Hungf"));
			    map.addMarker(new MarkerOptions().position(NGUYEN_CHI_THANH)
				        .title("Nguyễn Chí Thanh"));
			    
			    	

			    // Move the camera instantly to hamburg with a zoom of 15.
			    map.moveCamera(CameraUpdateFactory.newLatLngZoom(PHAM_HUNG, 12));

			    // Zoom in, animating the camera.
			    map.animateCamera(CameraUpdateFactory.zoomTo(12), 2000, null); 	
	}
}
